var enableaccess = function () {
    var that = $('.nr-toolbar').toolbar();
    var role_id = $(".role_id").val();
    //多选控制
    var rowids = that.grid.jqGrid('getGridParam', 'selarrrow');
    if (role_id == "") {
        sy.tip("错误，需要选择组授权！", "error");
    }
    sy.mask();
    if (rowids.length > 0) {
        // var rowdata = that.getRowFullDatas(rowids);
        //需要POST
        var url = sy.url({
            a: "enablewebaccess"
        })
        // function (url, data, success, async, error) 
        sy.post(url, { role_id: role_id, menu_ids: rowids }, function (res) {
            sy.tip(res.message, res.success);
            that.reloadGrid(true);
            sy.unmask();
        });
    }
    else
        sy.tip("请选择要授权的明细", "error");
}
$(function () {
    $('.nr-toolbar').toolbar('setFuncs', {
        enablewebaccess: function (rowid) {
            enableaccess();
        },
        disablewebaccess: function () {
            sy.mask();
            var that = this;
            var role_id = $(".role_id").val();
            //多选控制
            var rowids = that.grid.jqGrid('getGridParam', 'selarrrow');
            if (role_id == "") {
                sy.tip("错误，需要选择组！", "error");
            }

            if (rowids.length > 0) {
                // var rowdata = that.getRowFullDatas(rowids);
                //需要POST
                var url = sy.url({
                    a: "disablewebaccess"
                })
                // function (url, data, success, async, error) 
                sy.post(url, { role_id: role_id, menu_ids: rowids }, function (res) {
                    sy.tip(res.message, res.success);
                    that.reloadGrid(true);
                    sy.unmask();
                });
            }
            else
                sy.tip("请选择取消授权的明细", "error");
        }
    });
})